update

FFIB %!s(int64=10) %!d(string=hace) horas
padre
commit
b93c1d7599
Se han modificado 2 ficheros con 9 adiciones y 4 borrados
  1. 8 0
      api/encrypt_views.py
  2. 1 4
      api/sale/lottery_views.py

+ 8 - 0
api/encrypt_views.py

@@ -265,9 +265,17 @@ def decrypt2(request, v='v2'):
265 265
     else:
266 266
         activities = ActivityInfo.objects.filter(status=True).order_by('-pk')
267 267
         coupon_infos = [act.coupon_info3 for act in activities if act.has_unexpired_activity(model.model_name)]
268
+    
269
+    lotterys = LotteryCampaignInfo.objects.filter(status=True)
270
+   
271
+    if lotterys.exists():
272
+        active_lotterys = [lottery.data for lottery in lotterys if lottery.is_active()]
273
+    else:
274
+        active_lotterys = None
268 275
 
269 276
     return response(200, data={
270 277
         'plaintext': plaintext,
278
+        'lotterys': active_lotterys,
271 279
         'logo_url': brand.brand_logo_url if brand else '',
272 280
         'model_imgs': model.images if model else [],
273 281
         'code_version': mieli.version,

+ 1 - 4
api/sale/lottery_views.py

@@ -66,7 +66,4 @@ def lottery_join_api(request):
66 66
     if not campaign:
67 67
         return response(LotteryStatusCode.CAMPAIGN_NOT_FOUND)
68 68
 
69
-    return response(200, data={
70
-        'campaign': serialize_campaign(campaign),
71
-        'entry': serialize_entry(entry),
72
-    })
69
+    return response(200, 'join lottery campaign success', '参与抽奖成功')